<?php
 /**
 +------------------------------------------------------------------------------
 * 用户函数扩展
 +------------------------------------------------------------------------------

/**
* 截取字符
*/		
	function cutstr($str,$num,$ext=''){
		preg_match_all('/./us', $str, $match);
		$len= count($match[0]);
		$str= mb_substr($str,0,$num,'utf8');
		$ext_=substr($str,-1);
		if($len>$num && $ext_!='.')$str .=$ext;
		return $str;
	}
 /*  +------------------------------------------------------------------------------ */
?>